/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Algorithms;

import Models.MergedFriend;
import java.util.ArrayList;

/**
 *
 * @author Daniel
 */
 public class BubbleSort {
    
    public static ArrayList<MergedFriend> BubbleSort(ArrayList<MergedFriend> Data)
    {
        MergedFriend Buffer;
        int i,j;
        ArrayList<MergedFriend> Data2 = Data;
        
        for(i = 0; i< Data2.size();i++)
        {
            for(j = 0;j < i;j++)
            {
                if(Data2.get(i).getScore() > Data2.get(j).getScore())
                {
                    Buffer = Data2.get(j);
                    Data2.set(j, Data2.get(i));
                    Data2.set(i,Buffer);
                }
            }
        }
        
        
        
        return Data2;
    }
    
}
